using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.IO;
using System.Windows.Forms;
using System.Xml;

namespace DictCheck
{
    public partial class Form1 : Form
    {
        private DictUtils.WordChecker myChecker = new DictUtils.WordChecker("dict.txt");
        public Form1()
        {
            InitializeComponent();
            

        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.AppendText("init....\n\n");
            
            // Process every line in the file
            DictUtils.WordCounter wc = new DictUtils.WordCounter();
            DictUtils.SyntaxParser  myparser = new DictUtils.SyntaxParser();

            myparser.parse("input.txt");
            myparser.Dispose();

            /*
            
                        Int64 numLines, numWords, numChars, numBytes;
            Encoding fileEncoding = Encoding.UTF8;


            wc.CountStats("input.txt", fileEncoding, out numLines, out numWords, out numChars, out numBytes);
            IDictionaryEnumerator de = wc.GetWordsAlphabeticallyEnumerator();

 //           Console.WriteLine(String.Format("Word usage sorted alphabetically ({0} unique words)", wc.UniqueWords));
            //textBox1.Text.new
            while (de.MoveNext())
            {
                textBox1.AppendText(de.Key.ToString() + " - " + de.Value.ToString() + "\n");
            }
            
             */
            textBox1.AppendText("\n done!! \n");
            
             
            

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }
    }
}